//
//  BasicDataTypesViewController.swift
//  SwiftTest
//
//  Created by midea on 16/3/8.
//  Copyright © 2016年 Vincent. All rights reserved.
//

import Foundation
import UIKit

class BasicDataTypeViewController : BaseViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.titles = ["statement","tuple"]
        self.tableView?.reloadData()
    }
    
    fileprivate func statement() {
        let letData : CGFloat = 10.05
        var varData : Int = 5
        varData += 1
        let 去你的 = "去你的"
        
        print(letData)
        print(varData)
        print(去你的)
        
        print(Int8.min)
        print(Int8.max)
        print(UInt8.min)
        print(UInt8.max)
        
        let changeInt = varData + Int(letData)
        print(changeInt)
        
        let changeFloat = letData + CGFloat(varData)
        print(changeFloat)
        
        var boolType : Bool = false
        print(boolType)
        boolType = true
        print(boolType)
    }
    
    fileprivate func tuple() {
        let (int, stringA) = (10,"hello")
        print((int,stringA))
        
        let (_,_,stringB) = (0.05,2,"world")
        print((stringB))
    }
    
    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        super.tableView(tableView, didSelectRowAt: indexPath)
        
        switch indexPath.row {
        case 0:
            statement()
        case 1:
            tuple()
        default:
            print("no more methods")
        }
    }
}
